<style scoped>
.header{
  display: flex;
  flex-direction: column;
}
.header-top{
  width:100%;
  height:10px;
  background: transparent;
}
.head{
  height:50px;
  padding-top: 10px;
  /*border-bottom: 2px solid #dedde3;*/
  display: flex;
  justify-content: center;
  align-items:center;
  background: #ffffff;
  box-shadow:0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}
.head-left{
  position: absolute;
  width:40px;
  height:100%;
  left:0;
  top:0;
  color: #7f7a8e;
  text-align: center;
}
.head-left h1{
  margin-top: 22px;
}
.head-middle{
  font-size: 16px;
  color: #7f7a8e;
}
.head-right{
  position: absolute;
  right:14px;
  top:25px;
  color: #7f7a8e;
}
  .content{
    width:100%;
    color: #7F7A8E;
    background: #edf1f5;
    padding-top: 60px
  }
  .content>ul{
    display: flex;
    flex-direction: column;
  }
  .content>ul>li{
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid #E9E9E9;
    background: #ffffff;
    align-items: center;
  }
  .content>ul>li .left{
    flex:1;
  }
  .content>ul>li .right{
    flex:2;
    height:100%;
    display: flex;
    align-items: center;
  }
  .content>ul>li .right h3{
    flex: 1;
    /*margin-right: 4px;*/
  }
  .content>ul>li .right h2{
    margin-right: 4px;
  }
  @media screen and (max-width: 320px) {
    .content>ul>li{
      height:42px;
    }
    .content>ul>li .left{
      padding-left: 10px;
    }
    .next{
      height:35px;
    }
  }
  @media screen and (max-width:375px) and (min-width:321px) {
    .content>ul>li{
      height:54px;
    }
    .content>ul>li .left{
      padding-left: 12px;
    }
    .next{
      height:39px;
    }
  }
  @media screen and (min-width: 376px){
    .content>ul>li{
      height:66px;
    }
    .content>ul>li .left{
      padding-left: 18px;
    }
    .next{
      height:45px;
    }
  }
  .jy>.right>ul{
    display: flex;
    flex-direction: row;
  }
  .jy>.right>ul>li{
    display: flex;
    flex-direction: row;
    margin-left: 2px;
  }
  .jy>.right>ul>li h2{
    display: flex;
    align-items: center;
  }
  .mudi{
    height:80px!important;
    align-items: flex-start!important;
  }
  .mudi .left h3{
    margin-top: 10px;
  }
  .mudi .right ul{
    display: flex;
    flex-wrap: wrap;
    padding:4px 0;
  }
  .mudi .right ul li{
    display: flex;
    flex-direction: row;
    margin: 4px;
  }
  .mudi .right ul li:nth-child(2),.mudi .right ul li:nth-child(4){
    margin-left: 6px;
  }
  .next{
    position: fixed;
    bottom:0;
    width:100%;
    background: #fff;
    padding-bottom: 10px;
    padding-top: 10px;
  }
  .next>a{
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
    background: #4D66FF;
    border-radius: 4px;
  }
  .next>a h3{
    color: #ffffff;
  }
  .mint-popup-bottom{
    width:100%;
  }
  .color{
    color: #4D66FF;
  }
  .left{
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  .ptextleft{
    text-align: left!important;
  }
  .infomation{
    background: #ffd093;
    padding: 6px 16px;
  }
</style>

<template>
  <div class="open4">
    <div class="header" style="position: fixed;top: 0;width: 100%;z-index: 999999;height: 60px;background: white">
      <div class="head">
        <div class="head-left" @click="goBack"><h1 class="iconfont icon-xiangzuo1"></h1></div>
        <div class="head-middle"><h3>宽策略证券开户</h3></div>
        <div class="head-right"  @click="contact"><h1 class="iconfont icon-kefu3"></h1></div>
      </div>
    </div>
    <div class="content" style="margin-bottom: 79px;">
      <ul>
        <li>
          <div class="left">
            <h3>净年收入</h3>
            <h2 class="iconfont icon-wenhao" @click="jinYear"></h2>
          </div>
          <div class="right" @click="click1">
            <h3>{{annualIncomeData}}</h3>
            <h2 v-bind:class="{'icon-xiangxia2': down[0].down1,'icon-xiangyou1': down[0].right1}" class="iconfont "></h2>
          </div>
        </li>
        <p class="infomation" v-if="info1">{{information1}}</p>
        <li>
          <div class="left">
            <h3>流动净资产</h3>
          </div>
          <div class="right" @click="click2">
            <h3>{{currentAssetData}}</h3>
            <h2 v-bind:class="{'icon-xiangxia2': down[1].down1,'icon-xiangyou1': down[1].right1}" class="iconfont "></h2>
          </div>
        </li>
        <p class="infomation" v-if="info2">{{information2}}</p>
        <li>
          <div class="left">
            <h3>净资产</h3>
          </div>
          <div class="right" @click="click3">
            <h3>{{netAssetData}}</h3>
            <h2 v-bind:class="{'icon-xiangxia2': down[2].down1,'icon-xiangyou1': down[2].right1}" class="iconfont "></h2>
          </div>
        </li>
        <p class="infomation" v-if="info3">{{information3}}</p>
        <li>
          <div class="left">
            <h3>总资产</h3>
          </div>
          <div class="right" @click="click4">
            <h3>{{totalAssetData}}</h3>
            <h2 v-bind:class="{'icon-xiangxia2': down[3].down1,'icon-xiangyou1': down[3].right1}" class="iconfont "></h2>
          </div>
        </li>
        <p class="infomation"  v-if="info4">{{information4}}</p>
        <li>
          <div class="left">
            <h3>交易年限</h3>
          </div>
          <div class="right" @click="click5">
            <h3>{{tradeYearsData}}</h3>
            <h2 v-bind:class="{'icon-xiangxia2': down[4].down1,'icon-xiangyou1': down[4].right1}" class="iconfont "></h2>
          </div>
        </li>
        <p class="infomation" v-if="info5">{{information5}}</p>
        <li>
          <div class="left">
            <h3>交易年次数</h3>
          </div>
          <div class="right" @click="click6">
            <h3>{{tradeTimesData}}</h3>
            <h2 v-bind:class="{'icon-xiangxia2': down[5].down1,'icon-xiangyou1': down[5].right1}" class="iconfont "></h2>
          </div>
        </li>
        <li class="jy">
          <div class="left">
            <h3>交易经验</h3>
          </div>
          <div class="right">
            <ul>
              <li v-for="(jingyan,index) in jingyans">
                <h2 class="iconfont" v-bind:class="{'icon-yuanxingweixuanzhong':jingyan.choose,'icon-yuanxingxuanzhongfill color':jingyan.isChoose}" @click="clickThis(index)"></h2>
                <h3>{{jingyan.name.name}}</h3>
              </li>
            </ul>
          </div>
        </li>
        <p class="infomation" v-if="info6">{{information6}}</p>
        <li class="mudi">
          <div class="left">
            <h3>投资目的</h3>
          </div>
          <div class="right">
            <ul>
              <li v-for="(purpose,index) in purposes">
                <h2 class="iconfont icon-fangxingweixuanzhong" v-bind:class="{'icon-fangxingweixuanzhong': purpose.choose,'icon-fangxingxuanzhongfill color': purpose.isChoose}" @click="clickPurpose(index)"></h2>
                <h3>{{purpose.name}}</h3>
              </li>
            </ul>
          </div>
        </li>
      </ul>
    </div>
    <div class="next" @click="next">
      <router-link to=""><h3>下一步</h3></router-link>
    </div>
    <mt-popup1
      v-model="popupVisible1"
      v-if="mtPickerShow1"
      position="bottom">
      <div style="width: 100%;">
        <mt-picker1 :slots="slots1" class="picker" @change="change1"></mt-picker1>
      </div>
    </mt-popup1>
    <mt-popup2
      v-model="popupVisible2"
      v-if="mtPickerShow2"
      position="bottom">
      <div style="width: 100%;">
        <mt-picker2 :slots="slots2" @change="change2"></mt-picker2>
      </div>
    </mt-popup2>
    <mt-popup3
      v-model="popupVisible3"
      v-if="mtPickerShow3"
      position="bottom">
      <div style="width: 100%;">
        <mt-picker3 :slots="slots3" @change="change3"></mt-picker3>
      </div>
    </mt-popup3>
    <mt-popup4
      v-model="popupVisible4"
      v-if="mtPickerShow4"
      position="bottom">
      <div style="width: 100%;">
        <mt-picker4 :slots="slots4" @change="change4"></mt-picker4>
      </div>
    </mt-popup4>
    <mt-popup5
      v-model="popupVisible5"
      v-if="mtPickerShow5"
      position="bottom">
      <div style="width: 100%;">
        <mt-picker5 :slots="slots5" @change="change5"></mt-picker5>
      </div>
    </mt-popup5>
    <mt-popup6
      v-model="popupVisible6"
      v-if="mtPickerShow6"
      position="bottom"
      >
      <div style="width: 100%;">
        <mt-picker6 :slots="slots6" @change="change6"></mt-picker6>
      </div>
    </mt-popup6>
  </div>
</template>

<script>
  import myKh from '../components/kh.vue'
  import axios from 'axios'
  import host from '../config.js'
  import { Popup } from 'mint-ui'
  import { Picker } from 'mint-ui'
  import { Toast } from 'mint-ui'
  import { MessageBox } from 'mint-ui'


  export default {
    components: {
      myKh,
      mtPopup1: Popup,
      mtPopup2: Popup,
      mtPopup3: Popup,
      mtPopup4: Popup,
      mtPopup5: Popup,
      mtPopup6: Popup,
      mtPicker1: Picker,
      mtPicker2: Picker,
      mtPicker3: Picker,
      mtPicker4: Picker,
      mtPicker5: Picker,
      mtPicker6: Picker
    },
    data () {
      return {
        openPar: {},
        mtPickerShow1: false,
        mtPickerShow2: false,
        mtPickerShow3: false,
        mtPickerShow4: false,
        mtPickerShow5: false,
        mtPickerShow6: false,
        popupVisible1: false,
        popupVisible2: false,
        popupVisible3: false,
        popupVisible4: false,
        popupVisible5: false,
        popupVisible6: false,
        jingyans:[],
        purposes: [],
        annualIncomeData:'请选择净年收入',
        currentAssetData: '请选择流动净资产',
        netAssetData: '请选择净资产',
        totalAssetData: '请选择总资产',
        tradeYearsData: '请选择交易年限',
        tradeTimesData: '请选择年交易次数',
        slots1: [
          {
            flex: 1,
            values: []
          }
        ],
        slots2: [
          {
            flex: 1,
            values: []
          }
        ],
        slots3: [
          {
            flex: 1,
            values: []
          }
        ],
        slots4: [
          {
            flex: 1,
            values: []
          }
        ],
        slots5: [
          {
            flex: 1,
            values: []
          }
        ],
        slots6: [
          {
            flex: 1,
            values: []
          }
        ],
//        序号
        choose1: null,
        choose2: null,
        choose3: null,
        choose4: null,
        choose5: null,
        choose6: null,
//        向下
        down : [
          {down1: false, right1: true},
          {down1: false, right1: true},
          {down1: false, right1: true},
          {down1: false, right1: true},
          {down1: false, right1: true},
          {down1: false, right1: true}
        ],
        // 提示信息
        info1: false,
        info2: false,
        info3: false,
        info4: false,
        info5: false,
        info6: false,
        information1: '',
        information2: '',
        information3: '',
        information4: '',
        information5: '',
        information6: '交易经验不足以开通融资账户'
      }
    },
    watch: {
//      净年收入
      annualIncomeData (newData) {
        if(newData == this.openPar.annualIncome.choice[0]) {
          this.info1 = true
          this.information1 = '暂不支持5万美元以下资产开户'
        }else if(this.thisCompare(newData) > this.thisCompare2(this.currentAssetData)){
          this.info1 = true
          this.information1 = '流动净资产需大于净年收入'
        } else {
          this.info1 = false
        }
      },
//      流动净资产
      currentAssetData (newData) {
        if(newData == this.openPar.currentAsset.choice[0]) {
          this.info2 = true
          this.information2 = '暂不支持5万美元以下资产开户'
        }else if(this.thisCompare2(newData) < this.thisCompare(this.annualIncomeData)){
          this.info2 = true
          this.information2 = '流动净资产需大于净年收入'
          this.info1 = false
        }else if(this.thisCompare2(newData) > this.thisCompare2(this.netAssetData)) {
          this.info2 = true
          this.information2 = '净资产需大于流动净资产'
        }else {
          this.info2 = false
        }
      },
//      净资产
      netAssetData (newData) {
        if(newData == this.openPar.netAsset.choice[0]) {
          this.info3 = true
          this.information3 = '暂不支持5万美元以下资产开户'
        }else if(this.thisCompare2(newData) < this.thisCompare2(this.currentAssetData)){
          this.info3 = true
          this.information3 = '净资产需至少等于流动净资产'
          this.info2 = false
        }else if(this.thisCompare2(newData) > this.thisCompare2(this.totalAssetData)) {
          this.info3 = true
          this.information3 = '总资产需至少等于净资产'
        } else {
          this.info3 = false
        }
        if(this.thisCompare2(newData) <= this.thisCompare2(this.totalAssetData)) {
          this.info4 = false
        }
      },
//      总资产
      totalAssetData (newData) {
        if(newData == this.openPar.totalAsset.choice[0]) {
          this.info4 = true
          this.information4 = '暂不支持5万美元以下资产开户'
        }else if(this.thisCompare2(newData) < this.thisCompare2(this.netAssetData)){
          this.info4 = true
          this.information4 = '总资产需至少等于净资产'
          this.info3 = false
        } else {
          this.info4 = false
        }
        if(this.thisCompare2(newData) < this.thisCompare2(this.netAssetData)) {
          this.info3 = true
          this.information3 = '总资产需至少等于净资产'
        } else {
          this.info3 = false
        }
      },
      tradeYearsData  (newData) {
        if(newData == this.openPar.tradeYears.choice[1]) {
          this.info5 = true
          this.information5 = '交易年限不足以开通融资账户'
        }else{
          this.info5 = false
        }
      },
      jingyans (newData) {
      }
    },
    created () {
      let loopMap = (items, key, val) => {
        Object.keys(items[val].choice).forEach((item, idx) => {
          this[key].push({
            name: items[val].choice[item],
            eng: item,
            choose: true,
            isChoose: false
          })
        })
      }
      this.baseService.get('/trade/openAccountPara').then((res) => {
        loopMap(res.data, 'jingyans', 'tradeExp')
        loopMap(res.data, 'purposes', 'tradeTarget')
        this.openPar = res.data
        this.$store.state.personMoney = res.data
        this.networkPar()
      })
    },
    mounted () {
      let that = this
      axios({
        method: 'get',
        timeout: 60000,
        headers: {'Authorization':  window.localStorage.getItem('token')},
        url: host.host + '/api/v1/trade/personInfo'
      }).then(function(data){
        if(data.data.code === 6006) {
          that.$router.push('/login')
        }
        if(data.data.code == 6007){
          that.$refreshToken()
        }
        if(data.data.code ===200){
          let getData = data.data.data
          that.$store.state.openData = data.data.data
        }
      }).catch((err) => {
      })
//      else{

//      }
    },
    methods: {
//      对照方法
      networkPar () {
              let allChoose = this.$store.state.personMoney
      let money1 = [],money2 = [],money3 = [],money4 = [],money5 = [],money6 = []
      for (let m1 in allChoose.annualIncome.choice){
        if (allChoose.annualIncome.choice.hasOwnProperty(m1)){
          money1.push(m1)
        }
        this.slots1[0].values.push(allChoose.annualIncome.choice[m1])
      }

      for (let m2 in allChoose.currentAsset.choice){
        if (allChoose.currentAsset.choice.hasOwnProperty(m2)){
          money2.push(m2)
        }
        this.slots2[0].values.push(allChoose.currentAsset.choice[m2])
      }

      for (let m3 in allChoose.netAsset.choice){
        if (allChoose.netAsset.choice.hasOwnProperty(m3)){
          money3.push(m3)
        }
        this.slots3[0].values.push(allChoose.netAsset.choice[m3])
      }

      for (let m4 in allChoose.totalAsset.choice){
        if (allChoose.totalAsset.choice.hasOwnProperty(m4)){
          money4.push(m4)
        }
        this.slots4[0].values.push(allChoose.totalAsset.choice[m4])
      }

      for (let m5 in allChoose.tradeYears.choice){
        if (allChoose.tradeYears.choice.hasOwnProperty(m5)){
          money5.push(m5)
        }
        this.slots5[0].values.push(allChoose.tradeYears.choice[m5])
      }

      for (let m6 in allChoose.tradeTimes.choice){
        if (allChoose.tradeTimes.choice.hasOwnProperty(m6)){
          money6.push(m6)
        }
        this.slots6[0].values.push(allChoose.tradeTimes.choice[m6])
      }
//      if(this.$store.state.openData === undefined) {
//
//      }else{
        if(this.$store.state.openData.annualIncome != undefined) {
          let storeData = this.$store.state.openData
          for (let m1 in allChoose.annualIncome.choice){
            if (m1 === storeData.annualIncome){
              this.annualIncomeData = allChoose.annualIncome.choice[m1]
              this.choose1 = storeData.annualIncome
            }
          }
          for (let m2 in allChoose.currentAsset.choice){
            if (m2 === storeData.currentAsset){
              this.currentAssetData = allChoose.currentAsset.choice[m2]
              this.choose2 = storeData.currentAsset
            }
          }
          for (let m3 in allChoose.netAsset.choice){
            if (m3 === storeData.netAsset){
              this.netAssetData = allChoose.netAsset.choice[m3]
              this.choose3 = storeData.netAsset
            }
          }
          for (let m4 in allChoose.totalAsset.choice){
            if (m4 === storeData.totalAsset){
              this.totalAssetData = allChoose.totalAsset.choice[m4]
              this.choose4 = storeData.totalAsset
            }
          }
          for (let m5 in allChoose.tradeYears.choice){
            if (m5 === storeData.tradeYears){
              this.tradeYearsData = allChoose.tradeYears.choice[m5]
              this.choose5 = storeData.tradeYears
            }
          }
          for (let m6 in allChoose.tradeTimes.choice){
            if (m6 === storeData.tradeTimes){
              this.tradeTimesData = allChoose.tradeTimes.choice[m6]
              this.choose6 = storeData.tradeTimes
            }
          }
          for(let i = 0; i < this.jingyans.length; i++){
            if(storeData.tradeExp === this.jingyans[i].name.code) {
              this.jingyans[i].isChoose = true
              this.tradeExp = this.jingyans[i].name.code
            }
          }
          for(let j = 0; j < this.purposes.length; j++){
            if(this.purposes[j].eng === storeData.tradeTarget[0]) {
              this.purposes[j].isChoose = true
              this.tradeTarget = this.purposes.eng
            }
            if(this.purposes[j].eng === storeData.tradeTarget[1]) {
              this.purposes[j].isChoose = true
              this.tradeTarget = this.purposes.eng
            }
            if(this.purposes[j].eng === storeData.tradeTarget[2]) {
              this.purposes[j].isChoose = true
              this.tradeTarget = this.purposes.eng
            }
            if(this.purposes[j].eng === storeData.tradeTarget[3]) {
              this.purposes[j].isChoose = true
              this.tradeTarget = this.purposes.eng
            }
          }


//        }
      }
      },
      thisCompare (value) {
        let compare = []
        Object.keys(this.openPar.annualIncome.choice).forEach((item, idx) => {
          compare.push(this.openPar.annualIncome.choice[item])
        })
        let _index
        for (let i = 0; i < 6; i++){
          if (value === compare[i]){
            _index = i
          }
        }
        return _index
      },
      thisCompare2 (value) {
        let compare = []
        Object.keys(this.openPar.totalAsset.choice).forEach((item, idx) => {
          compare.push(this.openPar.totalAsset.choice[item])
        })
        let _index
        for (let i = 0; i < 6; i++){
          if (value === compare[i]){
            _index = i
          }
        }
        return _index
      },
      click1 () {
        this.mtPickerShow1 = true
        this.popupVisible1 = true
      },
      click2 () {
        this.mtPickerShow2 = true
        this.popupVisible2 = true
      },
      click3 () {
        this.mtPickerShow3 = true
        this.popupVisible3 = true
      },
      click4 () {
        this.mtPickerShow4 = true
        this.popupVisible4 = true
      },
      click5 () {
        this.mtPickerShow5 = true
        this.popupVisible5 = true
      },
      click6 () {
        this.mtPickerShow6 = true
        this.popupVisible6 = true
      },
      change1 (picker,value) {
        if (!value[0]) {
          if (this.choose1) {
            this.annualIncomeData = this.openPar.annualIncome.choice[this.choose1]
          } else {
            this.annualIncomeData = '请选择净年收入'
          }
          return
        }
        this.annualIncomeData = value[0]
        this.choose1 = this.thisCompare(value[0])
      },
      change2 (picker,value) {
        if (!value[0]) {
          if (this.choose2) {
            this.currentAssetData = this.openPar.currentAsset.choice[this.choose2]
          } else {
            this.currentAssetData = '请选择流动净资产'
          }
          return
        }
        this.currentAssetData = value[0]
        this.choose2 = this.thisCompare2(value[0])
      },
      change3 (picker,value) {
        if (!value[0]) {
          if (this.choose3) {
            this.netAssetData = this.openPar.netAsset.choice[this.choose3]
          } else {
            this.netAssetData = '请选择净资产'
          }
          return
        }
        this.netAssetData = value[0]
        this.choose3 = this.thisCompare2(value[0])
      },
      change4 (picker,value) {
        if (!value[0]) {
          if (this.choose4) {
            this.totalAssetData = this.openPar.totalAsset.choice[this.choose4]
          } else {
            this.totalAssetData = '请选择总资产'
          }
          return
        }
        this.totalAssetData = value[0]
        this.choose4 = this.thisCompare2(value[0])
      },
      change5 (picker,value) {
        if (!value[0]) {
          if (this.choose5) {
            this.tradeYearsData = this.openPar.tradeYears.choice[this.choose5]
          } else {
            this.tradeYearsData = '请选择交易年限'
          }
          return
        }
        this.tradeYearsData = value[0]
        let choose = this.openPar.tradeYears.choice
        for (var i in choose) {
          if(this.tradeYearsData === choose[i]){
            this.choose5 = i
          }
        }
      },
      change6 (picker,value) {
        if (!value[0]) {
          if (this.choose6) {
            this.tradeTimesData = this.openPar.tradeTimes.choice[this.choose6]
          } else {
            this.tradeTimesData = '请选择交易年限'
          }
          return
        }
        this.tradeTimesData = value[0]
        let choose = this.openPar.tradeTimes.choice
        for (var i in choose) {
          if(this.tradeTimesData === choose[i]){
            this.choose6 = i
          }
        }
      },
//      交易经验
      clickThis (index) {
        this.jingyans[index].name.code === 'limit' ? this.info6 = true : this.info6 = false
        for(let i = 0; i<this.jingyans.length; i++){
          this.jingyans[i].choose = true
          this.jingyans[i].isChoose = false
        }
        this.jingyans[index].choose = !this.jingyans[index].choose
        this.jingyans[index].isChoose = !this.jingyans[index].isChoose
      },
//      投资目的
      clickPurpose (index) {
        this.purposes[index].choose = !this.purposes[index].choose
        this.purposes[index].isChoose = !this.purposes[index].isChoose
      },
//      下一步
      next () {
        let that = this
        let tradeExp,tradeTarget = []
        for(let i = 0; i < this.jingyans.length; i++){
          if(this.jingyans[i].isChoose === true) {
            tradeExp = this.jingyans[i].eng
          }
        }
        for(let j = 0; j < this.purposes.length; j++){
          if(this.purposes[j].isChoose === true) {
            tradeTarget.push(this.purposes[j].eng)
          }
        }
        if (this.choose1 === null || this.choose1 === ''){
          Toast({
            message: '请选择净年收入',
            duration: 1000
          })
          return
        }
        if (this.choose2 === null || this.choose2 === ''){
          Toast({
            message: '请选择流动净资产',
            duration: 1000
          })
          return
        }
        if (this.choose3 === null || this.choose3 === ''){
          Toast({
            message: '请选择净资产',
            duration: 1000
          })
          return
        }
        if (this.choose4 === null || this.choose4 === ''){
          Toast({
            message: '请选择总资产',
            duration: 1000
          })
          return
        }
        if (this.choose5 === null || this.choose5 === ''){
          Toast({
            message: '请选择交易年限',
            duration: 1000
          })
          return
        }
        if (this.choose6 === null || this.choose6 === ''){
          Toast({
            message: '请选择年交易次数',
            duration: 1000
          })
          return
        }
        if (tradeExp === null || tradeExp === '' || tradeExp === undefined){
          Toast({
            message: '请选择交易经验',
            duration: 1000
          })
          return
        }
        if (tradeTarget === null || tradeTarget.length === 0 || tradeTarget === undefined){
          Toast({
            message: '请选择投资目的',
            duration: 1000
          })
          return
        }
        let sendData = {
          "annualIncome": this.choose1.toString(),
          "currentAsset": this.choose2.toString(),
          "netAsset": this.choose3.toString(),
          "totalAsset": this.choose4.toString(),
          "tradeExp": this.jingyans[tradeExp].name.code,
          "tradeTarget": tradeTarget,
          "tradeTimes": this.choose6,
          "tradeYears": this.choose5
        }
        axios({
          method: 'post',
          headers: {'Authorization': window.localStorage.getItem('token')},
          url: host.host + '/api/trade/financialInfo',
          data: JSON.stringify(sendData)
        }).then(function(data){
          if(data.data.code === 6006) {
            that.$router.push('/login')
          }
          if(data.data.code === 6007){
            that.$refreshToken()
          }
          if(data.data.code === 200){
            that.$router.push('/open5')
          } else {
            Toast({
              message: data.data.msg,
              duration: 1500
            })
          }
        })

      },
      goBack () {
        this.$router.push('./open3')
      },
      contact () {
        window.location.href = 'tel:400-900-6687'
      },
      // 净年收入
      jinYear () {
        let message = `
          <p style="text-align: left;line-height:30px;">净年收入：可理解为税后年收入总和。</P>
          <p style="text-align: left;line-height:30px;">流动净资产：持有的现金，可变现股票、银行理财产品等总和。</P>
          <p style="text-align: left;line-height:30px;">净资产：出去负债，贷款，房屋贷款后的资产综合值。</P>
          <p style="text-align: left;line-height:30px;">总资产：包含负债，贷款的资产总和值。</P>
        `
        MessageBox.alert(message, '资产说明')
      }
    }
  }
</script>
